﻿using System.Linq;
using DataEmailTemplate = NC.DAL.EmailTemplate;

namespace NC.DAL
{
   public  class EmailTemplateRepository:IEmailTemplateRepository
    {
        private readonly NCEntities _ncEntities;
        public EmailTemplateRepository()
        {
            _ncEntities = new NCEntities();
        }

        /// <summary>
        /// To get Email Content Details for Activation mail
        /// </summary>
        /// <param name="templateName">Email template name which needs to be retrieved from database</param>
        /// <returns></returns>
        public DataEmailTemplate GetEmailTemplateByName(string templateName)
        {
            return _ncEntities.EmailTemplates.FirstOrDefault(x => x.TemplateName == templateName);
        }
    }
}
